<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/commons/basejs.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>标签管理</title>
    <script type="text/javascript">

    </script>
</head>
<body>
<script type="text/javascript">
    $(function() {
        $('#rechargeForm').form({
            url : '${path }/userInfo/recharge.do',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                console.log(result);
                if (result.success) {
                    console.log("success:"+result.success);
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    console.log("error:"+result.success);
                    var form = $('#rechargeForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div style="padding: 3px;">
    <form id="rechargeForm" method="post">
        <table class="grid">

            <tr>
                <input type="hidden" name="id" value="${user.id}">
                <td>用户名</td>
                <td>${user.username}</td>
            </tr>

            <tr>
                <td>余额</td>
                <td>￥${user.money}</td>
            </tr>



            <tr>
                <td>操作</td>
                <td>
                    <select name="flag" class="easyui-combobox" data-options="width:70,height:29,editable:false,panelHeight:'auto'">
                        <option value="0">充值</option>
                        <option value="1">扣款</option>
                    </select>
                ￥<input name="money" type="text"  class="easyui-validatebox span2" data-options="width:60" >
                </td>


            </tr>
        </table>
    </form>

</div>
</body>
</html>